Programming Language:
    Complex Numbers | Linear Algebra | Fit Algorithms | Interpolation | Root Finding | ODE | FFT | Special Functions | Integration

    FIT ALGORITHMS

    - fitting with Xi -

    fit(func,param,x[,y][,wd][,we][,partol][,maxit][,ifixp][,ifixx] [,taufac][,sstol][,sclp][,scld][,report]) is suited for tuning parameters par in a function f to minimize the sum of squared weight orthogonal distances form the observations (x,y) to the curve determined by the parameters. Set the parameter \report to get a detailed report including the standard errors of the estimated Parameters (S.D. BETA) and the 95% confidence Interval. Example: the function f(x;b0,b1,b2):=b0+b1*(exp(b2*x)-1)^2 shall be fitted on a given set of data:

    (  1)>double[] f(double x[],double b[])
    (  2)>{return b[0]+b[1]*pow(exp(b[2]*x)-1,2);}
    Function f defined
    (  3)>beta={1500,-50,-0.1};
    (  4)>x={0,0,5,7,7.5,10,16,26,30,34,34.5,100};
    (  5)>y={1265,1263.6,1258,1254,1253,1249.8,1237,1218,1220.6,1213.8,1215.5,1212};
    (  6)>p=fit([(x;b0,b1,b2)->y:y=f(x,{b0,b1,b2});],beta,x,y);
    Message: sum of squares convergence
    (  7)>print(p);
    <dblarr>
       1264.6548   -54.018405 -0.087849692
    (  8)>plot(x,y,\marker=4);
    (  9)>plot(x,f(x,p),\curve);
    

    The other parameters are optional,

      • wd (type double array) weights the errors of the x-values,
      • we equivalently weights the errors of the y-values,
      • partol is the stopping tolerance for parameter convergence,
      • maxit specifies the maximum of iterations allowed,
      • ifixp is an integer array determing the parameters which are to be treated as fixed, the integer array
      • ifixx marks the x-values which are treated as without errors, the single value
      • taufac represents the trust region radius,
      • sstol specifies the stopping tolerance sum of squares convergence,
      • sclp is a double array which scales the parameters, the array
      • scld scales the errors of the x-values and at last the keyword
      • report determines if a report of the fitting algorithm is to be generated.
    For further details see User's Reference Guide for ODRPACK Version 2.01, Paul T. Boggs, Richard H. Byrd, Janet E. Rogers and Robert B. Schnabel, National Institute of Standards and Technology 1992.
    Rechts Index Index Index Linls © 1995 by Bodo Junglas, Klaus Spanderen and Fabian Weis
    - Last revised: April 23 1996